<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.webamc.common.enums.Fields" %>
<%@ page import="com.webamc.common.enums.Params" %>
<%@ page import="com.webamc.model.User" %>
<%@ page import="com.webamc.model.UserInfo" %>
<%@ page import="com.webamc.util.CommonUtil" %>
<link rel="stylesheet" href="../webamc.css"/>
<div class="action-header">USER</div>
<%
    User u = (User) request.getAttribute(Params.BEAN);
    if (u == null) {
%>
No user! <a href="user.html?action=browse">click here</a> to browse list.
<%
        return;
    }

    UserInfo ui = u.getUserInfo();
%>

<jsp:include page="msgs.jsp"/>

<table class="browse-table" border="1">
    <col width="10%"/>
    <col width="20%"/>
    <tr>
        <td>UserId</td>
        <td><%=u.getUserId()%>
        </td>
    </tr>
    <tr>
        <td>Username</td>
        <td><%=u.getUsername()%>
        </td>
    </tr>
    <tr>
        <td>Category</td>
        <td><%=CommonUtil.out(u.getCategory())%>
        </td>

    </tr>
    <tr>
        <td>Status</td>
        <td><%=CommonUtil.out(u.getStatus())%>
        </td>
    </tr>
    <tr>
        <td>Name</td>
        <td><%=CommonUtil.out(ui.getFullName())%>
        </td>
    </tr>
    <tr>
        <td>Gender</td>
        <td><%=CommonUtil.out(ui.getGender())%>
        </td>
    </tr>
    <tr>
        <td>DoB</td>
        <td><%=CommonUtil.getDateString(ui.getDob())%>
        </td>
    </tr>
    <tr>
        <td>Contacts</td>
        <td><%=CommonUtil.out(ui.getContacts())%>
        </td>
    </tr>
     <tr>
        <td>Mobile</td>
        <td><%=CommonUtil.out(ui.getMobile())%>
        </td>
    </tr>
    <tr>
        <td>email</td>
        <td><%=CommonUtil.out(ui.getEmails())%>
        </td>
    </tr>
    <tr>
        <td>Address</td>
        <td><%=CommonUtil.out(ui.getAddress())%>
        </td>
    </tr>
    <tr>
        <td>City</td>
        <td><%=CommonUtil.out(ui.getCity())%>
        </td>
    </tr>
    <tr>
        <td>State</td>
        <td><%=CommonUtil.out(ui.getState())%>
        </td>
    </tr>
    <tr>
        <td>Description</td>
        <td><%=CommonUtil.out(ui.getDescription())%>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            <a href="user.html?action=beforeUpdate&<%=Fields.USERID%>=<%=u.getUserId()%>">
                Update
            </a>
        </td>
    </tr>
</table>
